<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta name="theme-color" content="#222">



  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">

  <script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
  </script>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.ico?v=5.1.3">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico?v=5.1.3">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.ico?v=5.1.3">


  <link rel="mask-icon" href="/images/favicon.ico?v=5.1.3" color="#222">





  <meta name="keywords" content="Cobbler,极简教程系列," />










<meta name="description" content="Cobbler 快速入门指南 由于Cobbler涉及各种各样的技术，Cobbler可能是一个稍微复杂的系统，但它在安装后几乎不需要任何配置就支持大量功能。在开始使用Cobbler之前，您应该具备PXE相关知识以及所选发行版的自动化安装方法。 本快速入门指南将重点介绍红帽kickstart流程，该流程非常成熟并经过了充分测试。未来我们将为其他发行版（如Ubuntu和SuSE）添加快速入门指南。下面的">
<meta name="keywords" content="Cobbler,极简教程系列">
<meta property="og:type" content="article">
<meta property="og:title" content="Cobbler 快速入门指南">
<meta property="og:url" content="http://www.kangvcar.com/Cobbler-快速入门指南/index.html">
<meta property="og:site_name" content="Kangvcar | Blogs">
<meta property="og:description" content="Cobbler 快速入门指南 由于Cobbler涉及各种各样的技术，Cobbler可能是一个稍微复杂的系统，但它在安装后几乎不需要任何配置就支持大量功能。在开始使用Cobbler之前，您应该具备PXE相关知识以及所选发行版的自动化安装方法。 本快速入门指南将重点介绍红帽kickstart流程，该流程非常成熟并经过了充分测试。未来我们将为其他发行版（如Ubuntu和SuSE）添加快速入门指南。下面的">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-06-18T08:41:32.829Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Cobbler 快速入门指南">
<meta name="twitter:description" content="Cobbler 快速入门指南 由于Cobbler涉及各种各样的技术，Cobbler可能是一个稍微复杂的系统，但它在安装后几乎不需要任何配置就支持大量功能。在开始使用Cobbler之前，您应该具备PXE相关知识以及所选发行版的自动化安装方法。 本快速入门指南将重点介绍红帽kickstart流程，该流程非常成熟并经过了充分测试。未来我们将为其他发行版（如Ubuntu和SuSE）添加快速入门指南。下面的">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.3',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://www.kangvcar.com/Cobbler-快速入门指南/"/>



  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice")
  daovoice('init', {
      app_id: "f8921861"
    });
  daovoice('update');
  </script>





  <title>Cobbler 快速入门指南 | Kangvcar | Blogs</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
      <a href="https://github.com/kangvcar/kangvcar.github.io" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#FD6C6C; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<!--       <a href="https://github.com/kangvcar/kangvcar.github.io"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
 -->
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Kangvcar | Blogs</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">知识的广度是深度的副产品</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://www.kangvcar.com/Cobbler-快速入门指南/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Kangvcar">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Kangvcar | Blogs">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Cobbler 快速入门指南</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-06-16T02:43:22+08:00">
                2018-06-15
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Cobbler/" itemprop="url" rel="index">
                    <span itemprop="name">Cobbler</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/Cobbler-快速入门指南/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count"
                        data-disqus-identifier="Cobbler-快速入门指南/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  2,953
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  13
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Cobbler-快速入门指南"><a href="#Cobbler-快速入门指南" class="headerlink" title="Cobbler 快速入门指南"></a>Cobbler 快速入门指南</h1><hr>
<p>由于Cobbler涉及各种各样的技术，Cobbler可能是一个稍微复杂的系统，但它在安装后几乎不需要任何配置就支持大量功能。在开始使用Cobbler之前，您应该具备PXE相关知识以及所选发行版的自动化安装方法。</p>
<p>本快速入门指南将重点介绍红帽kickstart流程，该流程非常成熟并经过了充分测试。未来我们将为其他发行版（如Ubuntu和SuSE）添加快速入门指南。下面的步骤将集中在Fedora上，但它们应该适用于任何基于Red Hat的发行版，例如RHEL，CentOS或Scientific Linux。有关您的特定操作系统版本的安装和先决条件的详细信息，请参阅<a href="http://cobbler.github.io/manuals/2.8.0/2_-_Installing_Cobbler.html" target="_blank" rel="external">安装补丁程序</a>部分。</p>
<p>最后，本指南将只关注CLI应用程序。欲了解更多关于皮匠的网络用户界面的细节，请点击这里：<a href="http://cobbler.github.io/manuals/2.8.0/5_-_Web_Interface.html" target="_blank" rel="external">Cobbler Web用户界面</a></p>
<h2 id="Disable-SELinux-optional"><a href="#Disable-SELinux-optional" class="headerlink" title="Disable SELinux(optional)"></a>Disable SELinux(optional)</h2><hr>
<p>在开始使用Cobbler之前，最好禁用SELinux或将其设置为“permissive”模式，特别是您不熟悉SELinux故障排除或修改SELinux策略时。随着Cobbler不断发展，以及协助管理新的系统技术，并且OS随附的策略有时会落后于我们提供的功能集，导致AVC拒绝破坏了Cobbler的功能。</p>
<p>如果您想在运行cobblerd的系统上继续使用SELinux，请务必阅读本手册中的<a href="http://cobbler.github.io/manuals/2.8.0/4/2_-_SELinux.html" target="_blank" rel="external">SELinux With Cobbler</a>部分。</p>
<h2 id="Installing-Cobbler"><a href="#Installing-Cobbler" class="headerlink" title="Installing Cobbler"></a>Installing Cobbler</h2><hr>
<p>安装只需通过yum完成：（需要安装epel源<code>yum -y install epel-release</code>）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> yum install cobbler</span></span><br></pre></td></tr></table></figure>
<p>这将提供基本配置所有要求的文件。</p>
<h2 id="Changing-Settings"><a href="#Changing-Settings" class="headerlink" title="Changing Settings"></a>Changing Settings</h2><hr>
<p>在启动cobblerd服务之前，您应该修改一些配置。</p>
<p>Cobbler/Cobbler的配置存储在<code>/etc/cobbler/settings</code>。此文件是YAML格式的数据文件，因此在编辑此文件时务必小心，因为格式不正确的文件将阻止Cobbler/Cobbler运行。</p>
<h3 id="Default-Encrypted-Password"><a href="#Default-Encrypted-Password" class="headerlink" title="Default Encrypted Password"></a>Default Encrypted Password</h3><p>此设置控制了在kickstart期间为新系统设置的root密码。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">default_password_crypted: <span class="string">"<span class="variable">$1</span><span class="variable">$bfI7WLZz</span><span class="variable">$PxXetL97LkScqJFxnW7KS1</span>"</span></span><br></pre></td></tr></table></figure>
<p>您应该通过运行以下命令并将输出插入到上面的字符串中进行修改（请确保保存引号）：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> openssl passwd -1</span></span><br></pre></td></tr></table></figure>
<h3 id="Server-and-Next-Server"><a href="#Server-and-Next-Server" class="headerlink" title="Server and Next_Server"></a>Server and Next_Server</h3><p>服务器选项设置将用于指定cobbler服务器的IP地址。<strong><em>不要</em></strong>使用<code>0.0.0.0</code>，因为它不是监听地址。这应该设置为cobbler服务器的可用IP，以便与例如HTTP和TFTP之类的协议联系cobbler服务器。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># <span class="selector-tag">default</span>, <span class="selector-tag">localhost</span></span><br><span class="line"><span class="selector-tag">server</span>: 127<span class="selector-class">.0</span><span class="selector-class">.0</span><span class="selector-class">.1</span></span><br></pre></td></tr></table></figure>
<p>next_server选项用于指定DHCP/PXE下载网络引导文件的TFTP服务器的IP。通常，这将与服务器设置的IP相同。</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># <span class="selector-tag">default</span>, <span class="selector-tag">localhost</span></span><br><span class="line"><span class="selector-tag">next_server</span>: 127<span class="selector-class">.0</span><span class="selector-class">.0</span><span class="selector-class">.1</span></span><br></pre></td></tr></table></figure>
<h3 id="DHCP-Management-and-DHCP-Server-Template"><a href="#DHCP-Management-and-DHCP-Server-Template" class="headerlink" title="DHCP Management and DHCP Server Template"></a>DHCP Management and DHCP Server Template</h3><p>为了进行PXE引导，您需要一个DHCP服务器来分发地址，并将引导系统指向TFTP服务器，以便在其中下载网络引导文件。Cobbler可以通过manage_dhcp设置管理DHCP服务器：</p>
<figure class="highlight ldif"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># default, don't manage</span></span><br><span class="line"><span class="attribute">manage_dhcp</span>: 0</span><br></pre></td></tr></table></figure>
<p>将该设置更改为1，以便cobbler将根据cobbler附带的<code>dhcp.template</code>生成<code>dhcpd.conf</code>文件。根据您的网络设置对该模板进行修改：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> vi /etc/cobbler/dhcp.template</span></span><br></pre></td></tr></table></figure>
<p>对于大多数用途，您只需要修改该块：</p>
<figure class="highlight lsl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">subnet <span class="number">192.168</span><span class="number">.1</span><span class="number">.0</span> netmask <span class="number">255.255</span><span class="number">.255</span><span class="number">.0</span> &#123;</span><br><span class="line">     option routers             <span class="number">192.168</span><span class="number">.1</span><span class="number">.1</span>;</span><br><span class="line">     option domain-name-servers <span class="number">192.168</span><span class="number">.1</span><span class="number">.210</span>,<span class="number">192.168</span><span class="number">.1</span><span class="number">.211</span>;</span><br><span class="line">     option subnet-mask         <span class="number">255.255</span><span class="number">.255</span><span class="number">.0</span>;</span><br><span class="line">     filename                   <span class="string">"/pxelinux.0"</span>;</span><br><span class="line">     <span class="section">default</span>-lease-time         <span class="number">2.8</span><span class="number">.0</span>;</span><br><span class="line">     max-lease-time             <span class="number">43200</span>;</span><br><span class="line">     next-server                $next_server;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>无论如何，请确保不要修改<code>next-server $next_server;</code> 行，因为<code>$next_server</code>的值将从<code>/etc/cobbler/settings</code>文件读取。这个文件是一个cheetah模板，所以一定不要修改这行后面的任何内容：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"><span class="keyword">for</span> dhcp_tag <span class="keyword">in</span> <span class="variable">$dhcp_tags</span>.keys():</span></span><br></pre></td></tr></table></figure>
<p>彻底检查dhcpd.conf配置语法超出了本文档的范围，但有关更多信息，请参阅手册页以获取更多详细信息：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> man dhcpd.conf</span></span><br></pre></td></tr></table></figure>
<h2 id="Files-and-Directory-Notes"><a href="#Files-and-Directory-Notes" class="headerlink" title="Files and Directory Notes"></a>Files and Directory Notes</h2><hr>
<p>Cobbler多处使用了<code>/var</code>目录。该<code>/var/www/cobbler/ks_mirror</code>目录是存放所有发行版和存储库文件的地方，因此，您将需要为每个导入的发行版准备5-10GB的可用空间。</p>
<p>如果您已将Cobbler安装到包含分区的可用空间非常小的系统上<code>/var</code>，请阅读手册中的“ <a href="http://cobbler.github.io/manuals/2.8.0/2/5_-_Relocating_Your_Installation.html" target="_blank" rel="external">重新分配安装</a>”部分，以了解如何正确地重新安装。</p>
<h2 id="Starting-and-Enabling-the-Cobbler-Service"><a href="#Starting-and-Enabling-the-Cobbler-Service" class="headerlink" title="Starting and Enabling the Cobbler Service"></a>Starting and Enabling the Cobbler Service</h2><hr>
<p>一旦你更新了以上设置，你就可以启动服务了。Fedora现在使用<code>systemctl</code>来管理服务，但您仍然可以使用常规的init脚本：</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">$ systemctl start cobblerd.service</span><br><span class="line">$ systemctl <span class="builtin-name">enable</span> cobblerd.service</span><br><span class="line">$ systemctl status cobblerd.service</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">or</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">$<span class="built_in"> service </span>cobblerd start</span><br><span class="line">$ chkconfig cobblerd on</span><br><span class="line">$<span class="built_in"> service </span>cobblerd status</span><br></pre></td></tr></table></figure>
<p>如果一切顺利，你应该看到<code>status command</code>的输出如下所示：</p>
<figure class="highlight dts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">cobblerd.service - Cobbler Helper Daemon</span><br><span class="line"><span class="symbol">          Loaded:</span> loaded (<span class="meta-keyword">/lib/</span>systemd<span class="meta-keyword">/system/</span>cobblerd.service; enabled)</span><br><span class="line"><span class="symbol">          Active:</span> active (running) since Sun, <span class="number">17</span> Jun <span class="number">2012</span> <span class="number">13</span>:<span class="number">01</span>:<span class="number">28</span> <span class="number">-0500</span>; <span class="number">1</span>min <span class="number">44</span>s ago</span><br><span class="line">        Main PID: <span class="number">1234</span> (cobblerd)</span><br><span class="line"><span class="symbol">          CGroup:</span> name=systemd:<span class="meta-keyword">/system/</span>cobblerd.service</span><br><span class="line">                  └ <span class="number">1234</span> <span class="meta-keyword">/usr/</span>bin/python <span class="meta-keyword">/usr/</span>bin/cobblerd -F</span><br></pre></td></tr></table></figure>
<h2 id="Checking-for-Problems-and-Your-First-Sync"><a href="#Checking-for-Problems-and-Your-First-Sync" class="headerlink" title="Checking for Problems and Your First Sync"></a>Checking for Problems and Your First Sync</h2><hr>
<p>既然cobblerd服务已经启动并正在运行，那么是时候检查问题了。Cobbler的检查命令会提出一些建议，但重要的是要记住，<em>这些主要只是建议</em>，可能不是基本功能的关键。如果您正在运行iptables或SELinux，重要的是要查看任何可能与之相关的报告消息。</p>
<figure class="highlight smali"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler check</span><br><span class="line">The following are potential configuration items that you may want to fix:</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">.</span>...</span><br><span class="line"></span><br><span class="line"><span class="keyword">.</span>...</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Restart cobblerd<span class="built_in"> and </span>then run 'cobbler sync' to apply changes.</span><br></pre></td></tr></table></figure>
<p>如果您决定遵循所有建议，例如安装额外的软件包，进行配置更改等，请务必按照其建议重新启动Cobblerd服务，以便更改生效。</p>
<p>一旦你完成了<code>cobbler check</code>，现在是第一次同步的时候了。这并不是必须的，但在此时未能正确同步可能会导致配置问题。</p>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler <span class="keyword">sync</span></span><br><span class="line">task started: <span class="number">2012</span>-<span class="number">06</span>-<span class="number">24</span>_224243_sync</span><br><span class="line">task started (id=Sync, time=Sun Jun <span class="number">24</span> <span class="number">22</span>:<span class="number">42</span>:<span class="number">43</span> <span class="number">2012</span>)</span><br><span class="line">running <span class="keyword">pre</span>-<span class="keyword">sync</span> triggers</span><br><span class="line">...</span><br><span class="line">rendering DHCP <span class="keyword">files</span></span><br><span class="line">generating /etc/dhcp/dhcpd.<span class="keyword">conf</span></span><br><span class="line">rendering TFTPD <span class="keyword">files</span></span><br><span class="line">generating /etc/xinetd.d/tftp</span><br><span class="line">cleaning link caches</span><br><span class="line">runnin<span class="variable">g:</span> <span class="keyword">find</span> /var/lib/tftpboot/images/.link_cache -maxdepth <span class="number">1</span> -<span class="built_in">type</span> <span class="keyword">f</span> -links <span class="number">1</span> -exec rm -<span class="keyword">f</span> <span class="string">'&#123;&#125;'</span> <span class="string">';'</span></span><br><span class="line">received <span class="keyword">on</span> stdou<span class="variable">t:</span></span><br><span class="line">received <span class="keyword">on</span> stderr:</span><br><span class="line">running post-<span class="keyword">sync</span> triggers</span><br><span class="line">running <span class="keyword">python</span> triggers from /var/lib/cobbler/triggers/<span class="keyword">sync</span>/post/</span><br><span class="line">running <span class="keyword">python</span> trigger cobbler.modules.sync_post_restart_services</span><br><span class="line">runnin<span class="variable">g:</span> dhcpd -t -q</span><br><span class="line">received <span class="keyword">on</span> stdou<span class="variable">t:</span></span><br><span class="line">received <span class="keyword">on</span> stderr:</span><br><span class="line">runnin<span class="variable">g:</span> service dhcpd restart</span><br><span class="line">received <span class="keyword">on</span> stdou<span class="variable">t:</span></span><br><span class="line">received <span class="keyword">on</span> stderr:</span><br><span class="line">running <span class="keyword">shell</span> triggers from /var/lib/cobbler/triggers/<span class="keyword">sync</span>/post/</span><br><span class="line">running <span class="keyword">python</span> triggers from /var/lib/cobbler/triggers/<span class="keyword">change</span>/</span><br><span class="line">running <span class="keyword">python</span> trigger cobbler.modules.scm_track</span><br><span class="line">running <span class="keyword">shell</span> triggers from /var/lib/cobbler/triggers/<span class="keyword">change</span>/</span><br><span class="line"> TASK COMPLETE</span><br></pre></td></tr></table></figure>
<p>假设一切顺利，没有错误报告，您就可以继续下一步了。</p>
<h2 id="Importing-Your-First-Distribution"><a href="#Importing-Your-First-Distribution" class="headerlink" title="Importing Your First Distribution"></a>Importing Your First Distribution</h2><hr>
<p>Cobbler通过<code>cobbler import</code>命令自动添加发行版和配置文件。此命令可以（通常）自动检测您导入的分类类型和版本，并为您创建（一个或多个）具有正确设置的配置文件。</p>
<h3 id="Download-an-ISO-Image"><a href="#Download-an-ISO-Image" class="headerlink" title="Download an ISO Image"></a>Download an ISO Image</h3><p>为了导入发行版，您需要为您的发行版提供DVD ISO。<strong>注：</strong>您必须使用完整的DVD，而不是“Live CD”ISO。在这个例子中，我们将使用Fedora 28 x86_64 ISO，<a href="http://download.fedoraproject.org/pub/fedora/linux/releases/28/Server/x86_64/iso/Fedora-Server-dvd-x86_64-28-1.1.iso" target="_blank" rel="external">可以在这里下载</a>。</p>
<p>一旦下载这个文件，请将它挂载在某个目录下：</p>
<figure class="highlight vbscript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ mount -t iso9660 -o <span class="keyword">loop</span>,ro /path/<span class="keyword">to</span>/isos/Fedora-<span class="built_in">Server</span>-dvd-x86_64<span class="number">-28</span><span class="number">-1.1</span>.iso /mnt</span><br></pre></td></tr></table></figure>
<h3 id="Run-the-Import"><a href="#Run-the-Import" class="headerlink" title="Run the Import"></a>Run the Import</h3><p>您现在已准备好导入的发行版。名称和路径参数是导入的唯一且必需选项：</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler import <span class="attribute">--name</span>=fedora28 <span class="attribute">--arch</span>=x86_64 <span class="attribute">--path</span>=/mnt</span><br></pre></td></tr></table></figure>
<p><code>--arch</code>选项不需要指定，因为它通常会被自动检测。在这个例子中，我们这样做是为了防止找到多个体系结构（Fedora在完整的DVD上运行i386包，默认情况下，cobbler将创建x86_64和i386发行版）。</p>
<h3 id="Listing-Objects"><a href="#Listing-Objects" class="headerlink" title="Listing Objects"></a>Listing Objects</h3><p>如果在导入期间未报告错误，则可以查看有关在导入过程中创建的发行版和配置文件的详细信息。</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler distro list</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">$ cobbler<span class="built_in"> profile </span>list</span><br></pre></td></tr></table></figure>
<p>导入命令通常会创建至少一个<code>发行版/配置文件</code>对，其名称与上面显示的名称相同。在某些情况下（例如，当找到基于xen的内核时），将创建多个发行/配置文件对。</p>
<h3 id="Object-Details"><a href="#Object-Details" class="headerlink" title="Object Details"></a>Object Details</h3><p>这个报告命令显示了Cobbler Object的细节：</p>
<figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler distro report --name=fedora28-x86_64</span><br><span class="line"><span class="string">Name                           :</span> fedora28-x86_64</span><br><span class="line"><span class="string">Architecture                   :</span> x86_64</span><br><span class="line">TFTP Boot <span class="string">Files                :</span> &#123;&#125;</span><br><span class="line"><span class="string">Breed                          :</span> redhat</span><br><span class="line"><span class="string">Comment                        :</span></span><br><span class="line">Fetchable <span class="string">Files                :</span> &#123;&#125;</span><br><span class="line"><span class="string">Initrd                         :</span> <span class="regexp">/var/</span>www<span class="regexp">/cobbler/</span>ks_mirror<span class="regexp">/fedora28-x86_64/</span>images<span class="regexp">/pxeboot/</span>initrd.img</span><br><span class="line"><span class="string">Kernel                         :</span> <span class="regexp">/var/</span>www<span class="regexp">/cobbler/</span>ks_mirror<span class="regexp">/fedora28-x86_64/</span>images<span class="regexp">/pxeboot/</span>vmlinuz</span><br><span class="line">Kernel <span class="string">Options                 :</span> &#123;&#125;</span><br><span class="line">Kernel Options (Post Install)  : &#123;&#125;</span><br><span class="line">Kickstart <span class="string">Metadata             :</span> &#123;<span class="string">'tree'</span>: <span class="string">'http://@@http_server@@/cblr/links/fedora28-x86_64'</span>&#125;</span><br><span class="line">Management <span class="string">Classes             :</span> []</span><br><span class="line">OS <span class="string">Version                     :</span> fedora28</span><br><span class="line"><span class="string">Owners                         :</span> [<span class="string">'admin'</span>]</span><br><span class="line">Red Hat Management <span class="string">Key         :</span> &lt;&lt;inherit&gt;&gt;</span><br><span class="line">Red Hat Management <span class="string">Server      :</span> &lt;&lt;inherit&gt;&gt;</span><br><span class="line">Template <span class="string">Files                 :</span> &#123;&#125;</span><br></pre></td></tr></table></figure>
<p>正如你在上面看到的那样，<code>Kickstart Metadata</code>字段（内部为<code>--ksmeta</code>）用于各种变量，并且包含关键的<code>tree</code>变量。这些在kickstart模板中用于指定可以找到安装文件的URL。</p>
<p>其他要注意的是：有些字段被设置为<code>&lt;&lt; inherit &gt;&gt;</code>。这意味着他们将使用默认设置（在settings文件中找到），或者（对于配置文件，子配置文件和系统）将使用父对象中配置的设置。</p>
<h2 id="Creating-a-System"><a href="#Creating-a-System" class="headerlink" title="Creating a System"></a>Creating a System</h2><hr>
<p>现在您已拥有发行版和配置文件，您可以创建一个系统。配置文件可用于PXE启动，但Cobbler的大部分功能都围绕着<code>system object</code>。您可以提供更多的系统信息来给Cobbler使用。</p>
<p>首先，我们将根据导入期间创建的配置文件创建一个<code>system object</code>。创建<code>system</code>时，名称和配置文件是唯一且必需的两个字段：</p>
<figure class="highlight ada"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler system add <span class="comment">--name=test --profile=fedora28-x86_64</span></span><br><span class="line">$ cobbler system list</span><br><span class="line">test</span><br><span class="line">$ cobbler system report <span class="comment">--name=test</span></span><br><span class="line">Name                           : <span class="type">test</span></span><br><span class="line">TFTP Boot Files                : &#123;&#125;</span><br><span class="line">Comment                        :</span><br><span class="line">Enable gPXE?                   : 0</span><br><span class="line">Fetchable Files                : &#123;&#125;</span><br><span class="line">Gateway                        :</span><br><span class="line">Hostname                       :</span><br><span class="line">Image                          :</span><br><span class="line">IPv6 Autoconfiguration         : <span class="type">False</span></span><br><span class="line">IPv6 Default Device            :</span><br><span class="line">Kernel Options                 : &#123;&#125;</span><br><span class="line">Kernel Options (Post Install)  : &#123;&#125;</span><br><span class="line">Kickstart                      : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Kickstart Metadata             : &#123;&#125;</span><br><span class="line">LDAP Enabled                   : <span class="type">False</span></span><br><span class="line">LDAP Management <span class="keyword">Type</span>           <span class="type">: </span>authconfig</span><br><span class="line">Management Classes             : []</span><br><span class="line">Management Parameters          : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Monit Enabled                  : <span class="type">False</span></span><br><span class="line">Name Servers                   : []</span><br><span class="line">Name Servers Search Path       : []</span><br><span class="line">Netboot Enabled                : <span class="type">True</span></span><br><span class="line">Owners                         : ['<span class="type">admin</span>']</span><br><span class="line">Power Management Address       :</span><br><span class="line">Power Management ID            :</span><br><span class="line">Power Management Password      :</span><br><span class="line">Power Management <span class="keyword">Type</span>          <span class="type">: </span>ipmitool</span><br><span class="line">Power Management Username      :</span><br><span class="line">Profile                        : <span class="type">fedora28</span>-x86_64</span><br><span class="line">Proxy                          : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Red Hat Management Key         : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Red Hat Management Server      : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Repos Enabled                  : <span class="type">False</span></span><br><span class="line">Server Override                : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Status                         : <span class="type">production</span></span><br><span class="line">Template Files                 : &#123;&#125;</span><br><span class="line">Virt Auto Boot                 : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Virt CPUs                      : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Virt Disk Driver <span class="keyword">Type</span>          <span class="type">: </span>&lt;&lt;inherit&gt;&gt;</span><br><span class="line">Virt File Size(GB)             : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Virt Path                      : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Virt RAM (MB)                  : &lt;&lt;<span class="type">inherit</span>&gt;&gt;</span><br><span class="line">Virt <span class="keyword">Type</span>                      <span class="type">: </span>&lt;&lt;inherit&gt;&gt;</span><br></pre></td></tr></table></figure>
<p>创建<code>system object</code>的主要原因是网络配置。使用配置文件时，仅限于DHCP接口，但通过<code>system object</code>可以指定更多的网络配置选项。</p>
<p>所以现在我们将在<code>192.168.1/24</code>网络中设置一个简单的接口：</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler<span class="built_in"> system </span><span class="builtin-name">edit</span> <span class="attribute">--name</span>=test <span class="attribute">--interface</span>=eth0 <span class="attribute">--mac</span>=00:11:22:AA:BB:CC <span class="attribute">--ip-address</span>=192.168.1.100 <span class="attribute">--netmask</span>=255.255.255.0 <span class="attribute">--static</span>=1 <span class="attribute">--dns-name</span>=test.mydomain.com</span><br></pre></td></tr></table></figure>
<p>默认网关没有按每个NIC指定，因此只需单独添加（与主机名一同添加）：</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ cobbler<span class="built_in"> system </span><span class="builtin-name">edit</span> <span class="attribute">--name</span>=test <span class="attribute">--gateway</span>=192.168.1.1 <span class="attribute">--hostname</span>=test.mydomain.com</span><br></pre></td></tr></table></figure>
<p><code>--hostname</code>字段对应于本地系统名称，由<code>hostname</code>命令返回。<code>--dns-name</code>（可以根据NIC设置）应该对应于与该接口的IP绑定的DNS A记录。两者都不是必需的，但指定两者都是一个好习惯。某些高级功能（如配置管理）依赖于<code>--dns-name</code>字段进行系统记录查找。</p>
<p>无论何时编辑<code>system object</code>，cobbler都会执行所谓的”lite sync”，它会重新生成关键文件，如TFTP根目录中的PXE引导文件。有一件事情<strong>不会</strong>执行服务管理操作，例如重新生成dhcpd.conf重新启动DHCP服务。在添加带有静态接口的系统后，执行完整的“cobbler sync”是一个好主意，以确保dhcpd.conf文件被正确的静态租约重写并且服务被重启。</p>
<h2 id="官方链接"><a href="#官方链接" class="headerlink" title="官方链接"></a>官方链接</h2><hr>
<ul>
<li><a href="http://cobbler.github.io/manuals/quickstart/" target="_blank" rel="external">原文地址</a></li>
<li><a href="http://cobbler.github.io/manuals/2.8.0/" target="_blank" rel="external">Cobbler 手册</a></li>
</ul>

      
    </div>
    
    
    


  


    

    
      <div>
        <div align="center">
 
   <div class="">
   <p>&nbsp</p>
   <p>&nbsp</p>
   <p><span>
   <b>本文地址：</b><a href="/Cobbler-快速入门指南/" title="Cobbler 快速入门指南">http://www.kangvcar.com/Cobbler-快速入门指南/</a><br/><b>转载请注明出处，谢谢！</b>
   </span></p>
   </div>
 
</div>


<div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，随意打赏！您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.jpg" alt="Kangvcar 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.jpg" alt="Kangvcar 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------感谢您的阅读-------------</div>
    
</div>
      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Cobbler/" rel="tag"><i class="fa fa-tag"></i> Cobbler</a>
          
            <a href="/tags/极简教程系列/" rel="tag"><i class="fa fa-tag"></i> 极简教程系列</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Ansible极简教程/" rel="next" title="Ansible极简教程">
                <i class="fa fa-chevron-left"></i> Ansible极简教程
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_email">邮件</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_tqq">腾讯微博</a>
<a class="jiathis_button_douban">豆瓣</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
    </div>
  </div>


          </div>
          


          

  
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zMTgzNi84NDAw"></div>


  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/uploads/avatar.png"
                alt="Kangvcar" />
            
              <p class="site-author-name" itemprop="name">Kangvcar</p>
              <p class="site-description motion-element" itemprop="description">知识的广度是深度的副产品</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">28</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">13</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">32</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          <div class="links-of-author motion-element">
            
              
                <span class="links-of-author-item">
                  <a href="https://github.com/kangvcar" target="_blank" title="GitHub">
                    
                      <i class="fa fa-fw fa-github"></i>GitHub</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="http://cv.kangvcar.com" target="_blank" title="我的简历">
                    
                      <i class="fa fa-fw fa-user"></i>我的简历</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://twitter.com/kangvcar" target="_blank" title="Twitter">
                    
                      <i class="fa fa-fw fa-twitter"></i>Twitter</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="http://www.jianshu.com/u/d9c480744afd" target="_blank" title="简书">
                    
                      <i class="fa fa-fw fa-globe"></i>简书</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="http://blog.csdn.net/kangvcar" target="_blank" title="CSDN">
                    
                      <i class="fa fa-fw fa-globe"></i>CSDN</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://my.oschina.net/kangvcar/blog" target="_blank" title="OSChina">
                    
                      <i class="fa fa-fw fa-globe"></i>OSChina</a>
                </span>
              
                <span class="links-of-author-item">
                  <a href="mailto:kangvcar@126.com" target="_blank" title="E-Mail">
                    
                      <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                </span>
              
            
          </div>

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Cobbler-快速入门指南"><span class="nav-number">1.</span> <span class="nav-text">Cobbler 快速入门指南</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Disable-SELinux-optional"><span class="nav-number">1.1.</span> <span class="nav-text">Disable SELinux(optional)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Installing-Cobbler"><span class="nav-number">1.2.</span> <span class="nav-text">Installing Cobbler</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Changing-Settings"><span class="nav-number">1.3.</span> <span class="nav-text">Changing Settings</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Default-Encrypted-Password"><span class="nav-number">1.3.1.</span> <span class="nav-text">Default Encrypted Password</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Server-and-Next-Server"><span class="nav-number">1.3.2.</span> <span class="nav-text">Server and Next_Server</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#DHCP-Management-and-DHCP-Server-Template"><span class="nav-number">1.3.3.</span> <span class="nav-text">DHCP Management and DHCP Server Template</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Files-and-Directory-Notes"><span class="nav-number">1.4.</span> <span class="nav-text">Files and Directory Notes</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Starting-and-Enabling-the-Cobbler-Service"><span class="nav-number">1.5.</span> <span class="nav-text">Starting and Enabling the Cobbler Service</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Checking-for-Problems-and-Your-First-Sync"><span class="nav-number">1.6.</span> <span class="nav-text">Checking for Problems and Your First Sync</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Importing-Your-First-Distribution"><span class="nav-number">1.7.</span> <span class="nav-text">Importing Your First Distribution</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Download-an-ISO-Image"><span class="nav-number">1.7.1.</span> <span class="nav-text">Download an ISO Image</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Run-the-Import"><span class="nav-number">1.7.2.</span> <span class="nav-text">Run the Import</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Listing-Objects"><span class="nav-number">1.7.3.</span> <span class="nav-text">Listing Objects</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Object-Details"><span class="nav-number">1.7.4.</span> <span class="nav-text">Object Details</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Creating-a-System"><span class="nav-number">1.8.</span> <span class="nav-text">Creating a System</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#官方链接"><span class="nav-number">1.9.</span> <span class="nav-text">官方链接</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Kangvcar</span>

  
</div>


<div class="powered-by">
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_pv">
    本站访客数:<span id="busuanzi_value_site_pv"></span>次
</span>
</div>








  <span class="post-meta-divider">|</span>




<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共32.7k字</span>
</div>
        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.3"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script>



  


  

    
      <script id="dsq-count-scr" src="https://kangvcar.disqus.com/count.js" async></script>
    

    
      <script type="text/javascript">
        var disqus_config = function () {
          this.page.url = 'http://www.kangvcar.com/Cobbler-快速入门指南/';
          this.page.identifier = 'Cobbler-快速入门指南/';
          this.page.title = 'Cobbler 快速入门指南';
        };
        var d = document, s = d.createElement('script');
        s.src = 'https://kangvcar.disqus.com/embed.js';
        s.setAttribute('data-timestamp', '' + +new Date());
        (d.head || d.body).appendChild(s);
      </script>
    

  




	





  












<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>



  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  



  
    <script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
  
  
<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>

</body>
</html>
